//
// JTTextToken
//
// Copyright (C) jextra.net.
//
//  This file is part of the JavaTemplar Library.
//
//  The JavaTemplar Library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  The JavaTemplar Library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with the JavaTemplar Library; if not, write to the Free
//  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
//  02111-1307 USA.
//

package net.jextra.javatemplar.token;

import java.io.*;

/**
 * Represents a basic raw stream of text within the file. This will be output verbatim to the
 * input.
 */
public class JTTextToken implements JTToken
{
    // ============================================================
    // Fields
    // ============================================================

    private String _value;

    // ============================================================
    // Constructors
    // ============================================================

    public JTTextToken( String value )
    {
        _value = value;
    }

    // ============================================================
    // Methods
    // ============================================================

    // ----------
    // public
    // ----------

    @Override
    public JTToken clone()
    {
        return new JTTextToken( _value );
    }

    public String getValue()
    {
        return _value;
    }

    public void write( Writer out )
        throws Exception
    {
        out.write( _value );
    }
}

